<template>
  <div class="xfn-table-list">
    <el-breadcrumb>
      <el-breadcrumb-item to="/main">首页</el-breadcrumb-item>
      <el-breadcrumb-item>桌台管理</el-breadcrumb-item>
      <el-breadcrumb-item>桌台列表</el-breadcrumb-item>
    </el-breadcrumb>
    <br />
    <el-row>
      <el-col v-for="(t, i) in tableList" :key="i" :xs="12" :sm="8" :md="6" :lg="4" :xl="2">
        <xfn-table :data="t"></xfn-table>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import MyTable from "../components/Mytable";
export default {
  //将引入的子组件注册为xfn-table作为标签
  components: {
    "xfn-table": MyTable,
  },
  data() {
    return {
      tableList: [],
    };
  },
  mounted() {
    //发送ajax获取桌台列表信息
    let url = this.$store.state.globalSettings.apiUrl + "/tables";
    this.axios.get(url).then((res) => {
      let data = [...res.data];
      this.tableList = data;
    });
  },
};
</script>
